﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LevenBlog.Core.Install {
    public sealed class OperationResult {
        public bool Result { get; private set; }

        public string[] Errors { get; private set; }

        public OperationResult(bool result, string[] errors) {
            Result = result;
            Errors = errors;
        }

        public OperationResult(bool result, IList<string> errors)
            : this(result, errors.ToArray()) {
        }
    }

    public static class OperationResultExtension {
        public static string ToErrorString(this string[] errors) {
            return String.Join("<br />", errors);
        }
    }
}
